package com.qsxc.enums.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum StatusEnum {
	status0("0", "禁用"),
	status1("1", "正常");

	private final String value;

	private final String describe;

	public static StatusEnum getEnumByKey(String key) {
		for (StatusEnum s : StatusEnum.values()) {
			if (s.getValue().equals(key)) {
				return s;
			}
		}
		return null;
	}

	public static String getDescribeByKey(String key) {
		for (StatusEnum s : StatusEnum.values()) {
			if (s.getValue().equals(key)) {
				return s.getDescribe();
			}
		}
		return null;
	}
}
